﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Fantacid303.ProcessAffinityControl.Common;
using Fantacid303.ProcessAffinityControl.Manager.Extensions;
using System.Windows.Input;
using Fantacid303.ProcessAffinityControl.Manager.Properties;

namespace Fantacid303.ProcessAffinityControl.Manager.MainWindowViewModels
{
	partial class ConfigurationRuleViewModel
	{
		private class MyDeleteCommand : MyCommandBase<ConfigurationRuleViewModel>
		{
			public MyDeleteCommand(ConfigurationRuleViewModel model) : base(model)
			{

			}

			public override bool CanExecute(object parameter)
			{
				return true;
			}

			public override void Execute(object parameter)
			{
				this.Model.ConfigurationEntryViewModel.Rules.RemoveAll(a => a == this.Model);
				this.Model.ConfigurationEntryViewModel.ConfigurationViewModel.StatusMessage = Messages.ConfigNotSaved;
			}
		}

		/// <summary>
		/// Gets command which removes this entry from the parent.
		/// </summary>
		/// <value>The delete command.</value>
		public ICommand DeleteCommand { get; private set; }
    }
}
